5d5f243936b4fe6629ea6182066f81c2b8bff06d,mambuAndroid/src/main/java/com/mambu/android/EntityDetails.java,EntityDetails,setLoanProductLinking,#TableViewManager#,3283
Before Change
value = res.getString(R.string.core_any);
haveLinkedProduct = false;
}
tableManager.addPair(name, value);
// Auto-Link Accounts on their Creation. Yes/No
if (haveLinkedProduct) {
After Change
private void setLoanProductLinkingOrOffsetLinking(TableViewManager tableManager, LoanProduct loanProduct) {
// Start Product Linking Section or Offset Settings section. Many fields are shared by these two
if (loanProduct == null) {
return;
}
// Check if the Offset Linking or Product Linking section needs to be displayed. For Offset products some linking fields differ. See MBU-15608
boolean isOffsetLoan = loanProduct.isOffsetLoan();
// Start section: Offset Settings or Product Linking
String setName = isOffsetLoan ? res.getString(R.string.admin_offsetSettings) : res.getString(R.string.admin_productLinking);
tableManager.initializeSet(setName);
String name, value;
// Is Linking Activated.
boolean accountLinkingEnabled = loanProduct.isAccountLinkingEnabled();
name = res.getString(R.string.core_activated);
value = MambuData.getYesNoString(accountLinkingEnabled, res);
tableManager.addPair(name, value);
// If Activated, show available details
if (accountLinkingEnabled) {
// Linked Deposit Product
boolean haveLinkedProduct;
name = res.getString(R.string.admin_settlementDepositProduct);
if (mLinkedSavingsProduct != null) {
// Display Linked Savings product. Display as a "link" field: use NameValue to allow link clicking to display product details
value = mLinkedSavingsProduct.getName();
MambuEntity linkedEntity = new MambuEntity(loanProduct);
NameValue nameValue = new NameValue(name, value, linkedEntity);
tableManager.addPair(nameValue);
haveLinkedProduct = true;
} else {
value = res.getString(R.string.core_any);
haveLinkedProduct = false;
tableManager.addPair(name, value);
}
// Auto-Link Accounts on their Creation. Yes/No
if (haveLinkedProduct) {
// Is Auto-Set Settlement Accounts on Creation
name = res.getString(R.string.admin_autoSetSettlementAccountsOnCreation);
boolean autoCreateLinkAccounts = loanProduct.isAutoLinkAccounts();
value = MambuData.getYesNoString(autoCreateLinkAccounts, res);
tableManager.addPair(name, value);
// Is Auto-Create Settlement Accounts Yes/No
name = res.getString(R.string.admin_autoCreateSettlementAccount);
boolean autoCreateLinkToAccount = loanProduct.isAutoCreateLinkedAccounts();
value = MambuData.getYesNoString(autoCreateLinkToAccount, res);
tableManager.addPair(name, value);
}
// Offset percentage. For Offset Products only. Display Offset % value
BigDecimal offsetPercentage = loanProduct.getOffsetPercentage();
if (isOffsetLoan && offsetPercentage != null) {
name = res.getString(R.string.admin_offset);
// Format offset value as decimal and display with % string added
CurrencyFormatterHelper currencyFormatter = new CurrencyFormatterHelper(res);
value = currencyFormatter.bigDecimalToString(offsetPercentage) + res.getString(R.string.accounts_percentageSymbol);
tableManager.addPair(name, value);
}
// Settlement Options for linked accounts
SettlementOptions settlementOption = loanProduct.getSettlementOptions();